/**
 * @param {string} s
 * @return {number}
 */
export var minFlipsMonoIncr = function (s) {
  const dp = [0, 0]
  for (let i = 0; i < s.length; i++) {
    if (s[i] === '1') dp[0]++
    else dp[1]++
    dp[1] = Math.min(dp[0], dp[1])
  }
  return dp[1]
}
